package com.cjg.javaBasics;

public class Exception3 {

    //一个拿去错误的方法，抛出

    static void  test(int a ) throws Exception2 {
        if (a>5){
            throw new Exception2(a);
        }
        System.out.println("正常");
    }


    //try catch 接住异常
    public static void main(String[] args) {
        try {
            Exception3.test(5);
        } catch (Exception2 exception2) {
            System.out.println(exception2);
        }
    }




}
